<?php
namespace Home\Model;
use Think\Model;
class UserModel extends Model{   
    function register($name,$pass,$mail){
        $data=array();
        $data['name']=trim($name);
        $data['pass']=trim(md5($pass));
        $data['mail']=trim($mail);
        return  $this->data($data)->add();        
    }
    function dologins($name,$pass){
        $map=array();
        $map['name']=trim($name);
        $map['pass']=trim(md5($pass));
      return  $this->where($map)->find();
    }
   
    function doregisters($mail,$name){
        $data=array();
        $data['mail']=trim($mail);
        $data['name']=trim($name);
        return$this->where($data)->select();
    }
    function update($id){
        $map['id']=$id;
        return $this->where($map)->find();
    }
}

